Task: Develop software unit specification
Specification of a software unit based upon the software architectural design and the associated software safety requirements so it can be implemented.
Purpose
To specify the software unit based upon the software architectural design and the associated software safety requirements so it can be implemented.
Relationships
Main Description

This task covers the specification of the software units functional behavior and internal design down to the point where the software units can be implemented.

To ensure that the specification complies with good practices around software unit design and captures all the necessary information required to develop the item the design shall be described using a set of notations. Please refer to Table 7- Notations for software unit design, located in ISO 26262 vol 6 clause 8.4.1. The notations covered are the following:

Documentation of the software unit design in natural language is highly recommended for items of all ASILs a

Informal notations are highly recommended for items of ASIL A and B, and recommended for items of ASIL C or D

Semi-formal notations  are highly recommended for items of ASIL B,C or D , and recommended for items of ASIL A

Formal notations are recommended for  items of all ASILs

a Authors Note:- This can lead to misunderstanding due to the informal nature of natural language and its potential for ambiguity.

In the case of model-based development with automatic code generation, the methods for representing the software unit design have to be applied to the architectural model or parts of it. These models will serve as the basis for the code generation. This applies to semi formal notations such as UML and tools that support UML and code generation.

To achieve the properties of simplicity, robustness, maintainability, testability, readability and comprehensibility in the software unit design and to ensure that the following correspond to the software architectural design:-

Correct order of execution of subprograms and functions

Consistency of interfaces between software units

Correctness of control and data flow between and within the SW units

Please refer to "Table 8 - Design principles for software unit design and implementation" located in ISO 26262 vol 6 clause 8.4.4, this table details the use of the following design principles (with some further caveats detailed in the actual table, which the user is advised to examine).

One entry and one exit point in subprograms and functions

Initialization of variables

No hidden data flow or control flow

All the principles above are highly recommended for all ASIL levels

No dynamic objects or variables, or else online test during their creation

No multiple use of variable names

No implicit type conversions

No hidden data flow or control flow

The principles above are recommended for ASIL A and highly recommended for ASILs B,C and D.

Avoid global variables or else justify their usage

No recursions

The principles above are recommended for ASILs A and B and highly recommended for ASILs C and D.

Limited use of pointers is a technique that is recommended for ASILs B and C and highly recommended for ASIL D


To help with the development of this specification it is possible to use model based methods, see Collaboration Design - RT this provides the specification for the unit design and implementation.

Key Considerations

Practices applicable to help develop the software unit specification are

More Information